package com.gitee.center.runtime;

import com.sun.istack.internal.NotNull;

import java.util.Collections;
import java.util.List;

public abstract class BaseDecideStepsAbility<Model extends IDomainModel> extends BaseDomainAbility<Model,IDecideStepsExt> {
    private static final IDecideStepsExt defaultExt = new EmptyExt();
    public IDecideStepsExt defaultExtension(@NotNull Model model) {return defaultExt;}


    public List<String> decideSteps(@NotNull Model model, String activityCode) {
        return ((IDecideStepsExt)this.firstExtension(model)).decideSteps(model, activityCode);
    }

    private static class EmptyExt implements IDecideStepsExt{
        private static List<String> emptySteps = Collections.emptyList();
        private EmptyExt() {}

        @Override
        public List<String> decideSteps(IDomainModel model, String activityCode) {
            return emptySteps;
        }
    }
}
